package cn.ztuo.bitrade.controller.functionSwitch;

import cn.ztuo.bitrade.controller.BaseController;
import cn.ztuo.bitrade.service.FunctionSwitchService;
import cn.ztuo.bitrade.util.MessageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Xiazt
 * @date: 2020-04-22 10:35
 */
@RestController
@RequestMapping("functionSwitch")
public class FunctionSwitchController extends BaseController {

    @Autowired
    private FunctionSwitchService functionSwitchService;

    /**
     * 获取所有
     * @return
     */
    @RequestMapping("getAll")
    public MessageResult getAll(){
        return success(functionSwitchService.findAll());
    }

    /**
     * 根据功能名字获取一个
     * @param functionName
     * @return
     */
    @RequestMapping("getByFunctionName")
    public MessageResult getByFunctionName(String functionName){
        return success(functionSwitchService.findByFunctionName(functionName));
    }
}
